﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main.aspx.cs" Inherits="FL.Web.BackEnd.BasePage" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><% =SystemName %></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/SFramework/boot.js"></script>
    <script src="Scripts/common/juqery.Keyborad.js"></script>
    <script src="/Scripts/common/fullscreen.js"></script>
    <script src="/scripts/hotkey.js"></script>
    <script src="Scripts/jquery-1.10.2.min.js"></script>
    <script src="Scripts/jquery.signalR-2.2.1.min.js"></script>
    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .header {
            background: url(../header.gif) repeat-x 0 -1px;
        }


        body {
            font-size: 13px;
        }

        h1 {
            font-size: 20px;
            font-family: Verdana;
        }

        h4 {
            font-size: 16px;
            margin-top: 25px;
            margin-bottom: 10px;
        }

        .description {
            padding-bottom: 30px;
            font-family: Verdana;
        }

        .description h3 {
            color: #CC0000;
            font-size: 16px;
            margin: 0 30px 10px 0px;
            padding: 45px 0 8px;
            /*background:url(titleback.png) no-repeat scroll left bottom transparent*/
            border-bottom: solid 1px #888;
        }

        .mini-outlookbar-groupTitle {
            margin-left: 16px;
            /*text-align:center;*/
        }
    </style>
</head>
<body>

    <!--Layout-->
    <div id="layout1" class="mini-layout" style="width: 100%; height: 100%;">
        <div class="header" region="north" height="50" showsplit="false" showheader="false" style="overflow: hidden">
            <h1 style="margin: 0; padding: 10px; cursor: default; font-family: 微软雅黑,黑体,宋体;"><% =SystemName %> </h1>
            <div style="position: absolute; top: -10px; right: 500px;">
                <h3><span style="color: red">欢迎您:<% =User.name%></span><br />
                    <b id="top_message"></b></h3>
            </div>
            <div style="position: absolute; top: 3px; right: 10px;">
                <a id="_menu_view" class="mini-button mini-button-iconTop" iconcls="icon-date" plain="true" href="MainMatix.aspx">切换新版</a>
                <a class="mini-button mini-button-iconTop" iconcls="icon-date" onclick="fnFullScreen()" plain="true">全屏</a>
                <a class="mini-button mini-button-iconTop" iconcls="icon-edit" onclick="fnSetPassword('<%=User.id%>>')" plain="true">密码设置</a>
                <a class="mini-button mini-button-iconTop" iconcls="icon-close" onclick="fnLoginOut()" plain="true">退出</a>
            </div>
        </div>
        <div title="south" region="south" showsplit="false" showheader="false" height="30">
            <div style="line-height: 28px; text-align: center; cursor: default">Copyright ©  <% =DevCommpay %> </div>
        </div>
        <div title="center" region="center" style="border: 0;" bodystyle="overflow:hidden;">
            <!--Splitter-->
            <div class="mini-splitter" style="width: 100%; height: 100%;" borderstyle="border:0;" handlersize="8" id="main_splitter">
                <div size="150" maxsize="180" minsize="100" showcollapsebutton="true" style="border: 0;">
                    <!--OutlookTree-->
                    <div id="leftTree" class="mini-outlooktree" url="/extendpage/data/jsondata.aspx?entity=v_user_menu&condition=name<>'root' and user_id='@UserID'&type=1&order=path&desc=No" onnodeclick="onNodeSelect"
                        textfield="name" idfield="id" parentfield="parent_id">
                    </div>
                </div>
                <div showcollapsebutton="false" style="border: 0;">
                    <!--Tabs-->
                    <div id="mainTabs" class="mini-tabs" activeindex="0" style="width: 100%; height: 100%;" plain="false" onactivechanged="onTabsActiveChanged">
                        <div title="首页" url="../../ExtendPage/desktop/desktop.aspx">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
    </div>

   
    <script>
        var currentUser = <%=FL.Common.Globals.ObjectToJSON(User)%>;
            
        setTimeout(function(){
            if(limit_day<5)
            {
                $("#top_message").html("祝您愉快工作！");
                //$("#top_message").html("你的密码期限只有"+(limit_day)+"天，请尽快点击右侧的<a style='color:red'>密码设置</a>更改密码>>>");
                //alert("");
            }
            else{
                $("#top_message").html("祝您愉快工作！");
            }
        },50);
    </script>
    <script type="text/javascript">
      
        mini.parse();
        var tree = mini.get("leftTree");
        function showTab(node) {
            var tabs = mini.get("mainTabs");

            var id = "tab$" + node.id;
            var tab = tabs.getTab(id);
            //debugger
            if (!tab) {
                tab = {};
                tab._nodeid = node.id;
                tab.name = id;
                tab.title = node.text;
                tab.showCloseButton = true;
                //alert(node.url);
                //这里拼接了url，实际项目，应该从后台直接获得完整的url地址
                tab.url = node.url+"&functionid="+node.id;//mini_JSPath + "../../docs/api/" + node.id + ".html";
                //mini.get("main_splitter").hidePane(1);
                $("#_menu_view").show();
                tabs.addTab(tab);
            }
            tabs.activeTab(tab);
        }

        function addTab(title, url) {
            var tabs = mini.get("mainTabs");

            var id = "tab$" +Math.random();
            var tab = tabs.getTab(id);
            //debugger
            if (!tab) {
                tab = {};
                tab._nodeid = id;
                tab.name = id;
                tab.title = title;
                tab.showCloseButton = true;
                tab.url = url;
                tabs.addTab(tab);
            }
            tabs.activeTab(tab);
        }

        function onNodeSelect(e) {
            //debugger
            var node = e.node;
            var isLeaf = e.isLeaf;

            if (isLeaf) {
                showTab(node);
            }
        }

        function onClick(e) {
            var text = this.getText();
            alert(text);
        }
        function onQuickClick(e) {
            tree.expandPath("datagrid");
            tree.selectNode("datagrid");
        }

        function onTabsActiveChanged(e) {
            var tabs = e.sender;
            var tab = tabs.getActiveTab();
            if (tab && tab._nodeid) {

                var node = tree.getNode(tab._nodeid);
                if (node && !tree.isSelectedNode(node)) {
                    tree.selectNode(node);
                }
            }
        }
        function fnSetPassword(id) {
            mini.open({
                url: "/extendpage/template/editform/changpassword.aspx?id="+id,
                title: "修改密码", width: 450, height: 300,
                onload: function () {
                    //var iframe = this.getIFrameEl();
                    //var data = { action: "new" };
                    //iframe.contentWindow.SetData(data);
                },
                ondestroy: function (action) {
                    grid.reload();
                }
            });
        }

        function fnShowMenu()
        {
            $("#_menu_view").hide();
            mini.get("main_splitter").showPane(1);
        }
        //退出
        function fnLoginOut() {
            if(typeof(parent)=="undefined")
            {
                this.location = "loginOut.aspx";
            }else
            {
                parent.location= "loginOut.aspx";
            }
        }

        var i = 1;
        function _refresh() {
            $.get("online.aspx?action=reset&token=<%=Token%>").done(function (data) {
                setTimeout(_refresh, 3 * 1000*60);
            });
        }

        setTimeout(_refresh,3 * 1000*60);

        var fnFullScreen = function () {
            var el = document.documentElement;
            window.fullScreenApi.requestFullScreen(el);
        }


        jQuery.hotkeys.add('f2',function (){
            mini.get("layout1").hideRegion("north");   
            mini.get("layout1").hideRegion("south");   
            mini.get("main_splitter").hidePane(1);
        });

        jQuery.hotkeys.add('f3',function (){
            mini.get("main_splitter").showPane(1);
            mini.get("layout1").showRegion("north");  
            mini.get("layout1").showRegion("south");
        });

    </script>
    <script type="text/javascript">
        ////hst 2017-02-07 增加消息通知客户端功能
        ////闪动
        //blink("#childContainerId");
        //var connection = $.connection("/Connections/ChatConnections");
        //connection.received(function (data) {
        //    $('#msgCountId').val(data);
        //});
        //connection.start().done(function () {
       
        //});
        ////hst 2017-02-07 消息提醒闪动功能
        //function blink(selector) {
        //    $(selector).fadeIn('slow', function () {
        //        $(this).fadeOut('slow', function () {
        //            blink(this);
        //        });
        //    });
        //}
    </script>
</body>
</html>
